package com.ruoyi.shopping.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.employer.domain.CargoUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 商品订单对象 commodity_order
 * 
 * @author lfm
 * @date 2024-08-14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommodityOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /** 商品id */
    @Excel(name = "商品id")
    private Long commodityId;

    @TableField(exist = false)
    private Commodity commodity;


    @TableField(exist = false)
    private String goodsDescription;

    /** 数量 */
    @Excel(name = "数量")
    private Long count;

    /** 商品类型id */
    @Excel(name = "商品类型id")
    private Long commodityTypeId;

    @TableField(exist = false)
    private String goodsName;

    @TableField(exist = false)
    private CommodityType commodityType;

    /** 下单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderTime;

    /** 车主id */
    @Excel(name = "车主id")
    private Long cargoUserId;

    @TableField(exist = false)
    private String cargoUserName;

    @TableField(exist = false)
    private CargoUser cargoUser;
    /** 收货地址id */
    @Excel(name = "收货地址id")
    private Long commodityDeliveryAddressId;

    @TableField(exist = false)
    private CommodityDeliveryAddress commodityDeliveryAddress;

    /** 是否付款 */
    @Excel(name = "是否付款")
    private Long payOrNot;

    /** 是否收货 */
    @Excel(name = "是否收货")
    private Long goodsOrNot;

    @TableField(exist = false)
    private Long deliverOrNot;
    /** 是否取消 */
    @Excel(name = "是否取消")
    private Long cancelOrNot;

    /** 逻辑删除 */
    private Long del;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setCommodityId(Long commodityId) 
    {
        this.commodityId = commodityId;
    }

    public Long getCommodityId() 
    {
        return commodityId;
    }
    public void setCount(Long count) 
    {
        this.count = count;
    }

    public Long getCount() 
    {
        return count;
    }
    public void setCommodityTypeId(Long commodityTypeId) 
    {
        this.commodityTypeId = commodityTypeId;
    }

    public Long getCommodityTypeId() 
    {
        return commodityTypeId;
    }
    public void setOrderTime(Date orderTime) 
    {
        this.orderTime = orderTime;
    }

    public Date getOrderTime() 
    {
        return orderTime;
    }
    public void setCargoUserId(Long cargoUserId) 
    {
        this.cargoUserId = cargoUserId;
    }

    public Long getCargoUserId() 
    {
        return cargoUserId;
    }
    public void setCommodityDeliveryAddressId(Long commodityDeliveryAddressId) 
    {
        this.commodityDeliveryAddressId = commodityDeliveryAddressId;
    }

    public Long getCommodityDeliveryAddressId() 
    {
        return commodityDeliveryAddressId;
    }
    public void setPayOrNot(Long payOrNot) 
    {
        this.payOrNot = payOrNot;
    }

    public Long getPayOrNot() 
    {
        return payOrNot;
    }
    public void setGoodsOrNot(Long goodsOrNot) 
    {
        this.goodsOrNot = goodsOrNot;
    }

    public Long getGoodsOrNot() 
    {
        return goodsOrNot;
    }
    public void setCancelOrNot(Long cancelOrNot) 
    {
        this.cancelOrNot = cancelOrNot;
    }

    public Long getCancelOrNot() 
    {
        return cancelOrNot;
    }
    public void setDel(Long del) 
    {
        this.del = del;
    }

    public Long getDel() 
    {
        return del;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("commodityId", getCommodityId())
            .append("count", getCount())
            .append("commodityTypeId", getCommodityTypeId())
            .append("orderTime", getOrderTime())
            .append("cargoUserId", getCargoUserId())
            .append("commodityDeliveryAddressId", getCommodityDeliveryAddressId())
            .append("payOrNot", getPayOrNot())
            .append("goodsOrNot", getGoodsOrNot())
            .append("cancelOrNot", getCancelOrNot())
            .append("del", getDel())
            .toString();
    }
}
